﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<CourseSystem.Core.Entities.ChapterInfo>>" %>
<%@ Import Namespace="Chowpoo.Util" %>
<%@ Import Namespace="CourseSystem.Common.Helpers" %>
<%
    var currInfo = ViewData["curr"] as CourseSystem.Core.Entities.SectionInfo;
    if (currInfo == null)
        return;

    var type = ViewData["type"].CheckInt(0);
    if (type >= 2)
        type = type - 2;
%>
<td width="222" height="343" align="center" valign="top">
    <table width="222" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height="37" background="<%=ResolveUrl("~/Content/images/6_000.jpg") %>">
                 <div style="color: White; text-align: center; font-size: 17px; font-weight: bold">
                                            作业测验</div>
            </td>
        </tr>
        <tr>
            <td height="120" align="center" valign="top" background="<%=ResolveUrl("~/Content/images/3_20.jpg") %>">
                <% foreach (var item in Model)
                   {%>
                <table width="200" height="24" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="24" class="style6">
                            &nbsp;
                        </td>
                        <td width="152" class="style15">
                            <div align="left" class="<%=item.Id==currInfo.ChapterId?"style30":"style26NoBold" %>">
                                <%=item.Name %></div>
                        </td>
                        <td width="24" class="style15">
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <table width="216" height="1" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="17">
                        </td>
                        <td width="184" background="<%=ResolveUrl("~/Content/images/3.gif") %>">
                        </td>
                        <td width="15">
                        </td>
                    </tr>
                </table>
                <%foreach (var section in item.SectionInfo.OrderBy(o => o.OrderId))
                  { %>
                <table width="200" height="24" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="54" class="style6">
                            &nbsp;
                        </td>
                        <td width="146" class="style15">
                            <div align="center" class="style24">
                                <div align="left" class="<%=section.Id==currInfo.Id?"blod":"style15" %>">
                                    <a class="style26NoBold" href="<%=Url.Action("Homework","ExamLib",new{section.Id,type}) %>">
                                        <%=section.Name%></a></div>
                            </div>
                        </td>
                    </tr>
                </table>
                <%} %>
                <table width="216" height="1" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="17">
                        </td>
                        <td width="184" background="<%=ResolveUrl("~/Content/images/3.gif") %>">
                        </td>
                        <td width="15">
                        </td>
                    </tr>
                </table>
                <%}  %>
            </td>
        </tr>
        <tr>
            <td align="center" valign="top" background="<%=ResolveUrl("~/Content/images/3_20.jpg") %>">
                <table width="200" height="24" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="24" class="style6">
                            &nbsp;
                        </td>
                        <td width="152" class="style15">
                            <div align="left" class="<%=-1==currInfo.ChapterId?"style30":"" %>">
                                <%=Html.ActionLink("课程练习", "Homework", new { type = 2 }, new { @class = "style30" })%>
                                <%=Html.ActionLink("课程作业", "Homework", new { type = 3 }, new { @class = "style30" })%>
                            </div>
                        </td>
                        <td width="24" class="style15">
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <table width="216" height="1" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="17">
                        </td>
                        <td width="184" background="<%=ResolveUrl("~/Content/images/3.gif") %>">
                        </td>
                        <td width="15">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td height="9" background="<%=ResolveUrl("~/Content/images/3_22.jpg") %>">
            </td>
        </tr>
    </table>
</td>
